package com.itheima.reggie.common;


import lombok.Data;

@Data
public class ResultInfo {
    private Integer code;
    private String msg;
    private Object data;

    /*成功结果*/
    public static ResultInfo success(Object data){
        ResultInfo resultInfo = new ResultInfo();
        resultInfo.code = 1;
        resultInfo.data = data;
        return resultInfo;
    }

    /*失败结果*/
    public static ResultInfo error(String msg){
        ResultInfo resultInfo = new ResultInfo();
        resultInfo.code = 0;
        resultInfo.msg = msg;
        return resultInfo;
    }


}
